// axios 基础封装
import axios from 'axios'

const httpInstance = axios.create({
   baseURL: 'https://pcapi-xiaotuxian-front-devtest.itheima.net',
   timeout: 5000

})

httpInstance.interceptors.request.use(config => {
   // 在发送请求之前做一些处理
   return config
}, e => Promise.reject(e))

httpInstance.interceptors.response.use(res => res.data, e => {
   // 对响应数据做点什么
   return Promise.reject(e)
})

export default httpInstance